#include <crbsplus.h>

int _tmain(int argc, _TCHAR* argv[])
{
	cr::bitstring<10> bstr;
	TRACE(_T("dump 0: "));
	bstr.dump();
	TRACE(_T("\n"));
	bstr.append(true);
	TRACE(_T("dump 1: "));
	bstr.dump();
	TRACE(_T("\n"));
	bstr.catbits(cr::const_bit_addr((byte*)"0", 0), 2);
	TRACE(_T("dump 3: "));
	bstr.dump();
	TRACE(_T("\n"));
	bstr.setbits(cr::const_bit_addr((byte*)"590", 0), 9);
	TRACE(_T("dump 9: "));
	bstr.dump();
	TRACE(_T("\n"));
	char buf[10];
	bitcopy(buf, bstr.buffer(), bstr.length(), 0, 0);
	TRACE(_T("dump 9: "));
	wchar_t str[512];
	wsbprintf<512>(str, buf, bstr.length());
	TRACEW(str);
	TRACE(_T("\n"));
	bstr.erase(5
		//, 1
		);
	TRACE(_T("dump 8: "));
	bstr.dump();
	TRACE(_T("\n"));
	bstr.insert(true
		//, 5
		);
	TRACE(_T("dump 9: "));
	bstr.dump();
	TRACE(_T("\n"));
	bstr.clear();
	TRACE(_T("dump 0: "));
	bstr.dump();
	TRACE(_T("\n"));

	system("PAUSE");
	return 0;
}

